vue 怎么修改 confirm 的文字样式和颜色 |
您所在的位置:网站首页 › vant dialog confirm › vue 怎么修改 confirm 的文字样式和颜色 |
像是这种弹出框我们一般很少去做文字样式修改,但是也免不了要修改 现在就是这样,有一个需求是要做下样式的修改 通常我们都是这样写,但是当需要修改文本样式的时候,我们需要 createElement 新建元素和对象,然后对新建的元素进行标签化设置 this.$confirm('内容提示',{ type:'warning' }) .then(()=>{ done() }) .catch(()=>{})修改文本样式代码 const h = this.$createElement this.$confirm('', { title:"提示", type:'warnig', message:h('p', null, [ h('span', null, '内容可以是 '), h('i', { style: 'color: red' }, 'xxxxx') ]), // iconClass:"el-icon-question colorYellow", }) .then(_ => { done() }) .catch(_ => {});如果需要 icon 图标,需要把注释代码打开,其中 colorYellow 表示图标颜色 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |